home *** CD-ROM | disk | FTP | other *** search
- class Leaderboard extends MovieClip
- {
- var onEnterFrame;
- var sURL;
- var btnBack;
- var lvScores;
- var mcCnt;
- var mcScrollBar;
- function Leaderboard()
- {
- super();
- this.onEnterFrame = this.init;
- }
- function init(Void)
- {
- this.onEnterFrame = null;
- this.sURL = Application.sBasePath + "GetScores.php";
- this.loadHighScore();
- this.btnBack = this._parent.btnBack;
- this.btnBack.onRelease = mx.utils.Delegate.create(this,this.onReleaseBack);
- trace("btnBack: " + this.btnBack);
- }
- function loadHighScore(Void)
- {
- this.lvScores = new LoadVars();
- this.lvScores.onLoad = mx.utils.Delegate.create(this,this.onLoadList);
- this.lvScores.load(this.sURL);
- }
- function onLoadList(bSuccess)
- {
- for(var _loc4_ in this.lvScores)
- {
- trace("key: " + _loc4_ + ", value: " + this.lvScores[_loc4_]);
- }
- §§push(this.gotoAndStop("done"));
- if(bSuccess)
- {
- var _loc2_ = 1;
- while(_loc2_ < 21)
- {
- if(this.lvScores["name" + _loc2_] != undefined)
- {
- var _loc3_ = this.mcCnt.attachMovie("scoreRow","row" + _loc2_,_loc2_);
- _loc3_.rank = _loc2_ + ".";
- _loc3_.sName = this.lvScores["name" + _loc2_];
- _loc3_.score = this.lvScores["score" + _loc2_];
- _loc3_._y = 15 * (_loc2_ - 1);
- }
- _loc2_ = _loc2_ + 1;
- }
- }
- this.mcScrollBar.attachScrollBar(this.mcCnt,1);
- }
- function onReleaseBack(Void)
- {
- trace("asd");
- Interface.getInstance().onReleaseScoreBack();
- }
- }
-